Class BinaryInstruction<TValue, TValueType>
Base class for binary operator instructions with the same input and output types.
Assembly: WaaS.Core.dll
public abstract class BinaryInstruction<TValue, TValueType> : Instruction where TValue : unmanaged where TValueType : struct, IValueType<TValue>
Inheritance: System.Object
-> WaaS.Models.Instruction
Derived:
Expand
WaaS.Models.AddF32, WaaS.Models.AddF64, WaaS.Models.AddI32, WaaS.Models.AddI64, WaaS.Models.AndI32, WaaS.Models.AndI64, WaaS.Models.CopysignF32, WaaS.Models.CopysignF64, WaaS.Models.DivF32, WaaS.Models.DivF64, WaaS.Models.DivI32S, WaaS.Models.DivI32U, WaaS.Models.DivI64S, WaaS.Models.DivI64U, WaaS.Models.MaxF32, WaaS.Models.MaxF64, WaaS.Models.MinF32, WaaS.Models.MinF64, WaaS.Models.MulF32, WaaS.Models.MulF64, WaaS.Models.MulI32, WaaS.Models.MulI64, WaaS.Models.OrI32, WaaS.Models.OrI64, WaaS.Models.RemI32S, WaaS.Models.RemI32U, WaaS.Models.RemI64S, WaaS.Models.RemI64U, WaaS.Models.RotlI32, WaaS.Models.RotlI64, WaaS.Models.RotrI32, WaaS.Models.RotrI64, WaaS.Models.ShlI32, WaaS.Models.ShlI64, WaaS.Models.ShrI32S, WaaS.Models.ShrI32U, WaaS.Models.ShrI64S, WaaS.Models.ShrI64U, WaaS.Models.SubF32, WaaS.Models.SubF64, WaaS.Models.SubI32, WaaS.Models.SubI64, WaaS.Models.XorI32, WaaS.Models.XorI64
Methods
Execute(WasmStackFrame)
Executes the instruction.
View Source
public override void Execute(WasmStackFrame current)
Parameters
Type | Name |
---|---|
WaaS.Runtime.WasmStackFrame | current |
Operate(TValue, TValue)
View Source
protected abstract TValue Operate(TValue lhs, TValue rhs)
Returns
<TValue>
Parameters
Type | Name |
---|---|
<TValue> | lhs |
<TValue> | rhs |
PreValidateStackState(in ValidationContext)
Get the number of values to pop and push from the stack to validate stack depth.
View Source
public override (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns
System.ValueTuple<System.UInt32,System.UInt32>
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |
ValidateStackState(in ValidationContext, ref ValidationBlockStackState)
Simulates stack operations to validate the stack state.
View Source
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |
WaaS.Models.ValidationBlockStackState | stackState |